package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the TM_PERMISO_ASIG database table.
 * 
 */
@Embeddable
public class TmPermisoAsigPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private String perfilId1;
	private String permisoId;
	private String perfilId2;

    public TmPermisoAsigPK() {
    }

	@Column(name="PERFIL_ID_1", unique=true, nullable=false, length=3)
	public String getPerfilId1() {
		return this.perfilId1;
	}
	public void setPerfilId1(String perfilId1) {
		this.perfilId1 = perfilId1;
	}

	@Column(name="PERMISO_ID", unique=true, nullable=false, length=3)
	public String getPermisoId() {
		return this.permisoId;
	}
	public void setPermisoId(String permisoId) {
		this.permisoId = permisoId;
	}

	@Column(name="PERFIL_ID_2", unique=true, nullable=false, length=3)
	public String getPerfilId2() {
		return this.perfilId2;
	}
	public void setPerfilId2(String perfilId2) {
		this.perfilId2 = perfilId2;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof TmPermisoAsigPK)) {
			return false;
		}
		TmPermisoAsigPK castOther = (TmPermisoAsigPK)other;
		return 
			this.perfilId1.equals(castOther.perfilId1)
			&& this.permisoId.equals(castOther.permisoId)
			&& this.perfilId2.equals(castOther.perfilId2);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.perfilId1.hashCode();
		hash = hash * prime + this.permisoId.hashCode();
		hash = hash * prime + this.perfilId2.hashCode();
		
		return hash;
    }
}